-
Notifications
You must be signed in to change notification settings - Fork 24.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Speedup snapshot stale indices delete #64513
Conversation
Pinging @elastic/es-distributed (:Distributed/Snapshot/Restore) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @piyushdaftary , one ask :)
server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java
Outdated
Show resolved
Hide resolved
Thanks @piyushdaftary and sorry for letting this fall of my radar for a bit. I'll do my best to review this one today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice work @piyushdaftary ! Sorry again it took me so long to review this.
Just a few open details here, but the general solution is exactly what I had in mind, thanks!
server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java
Show resolved
Hide resolved
server/src/internalClusterTest/java/org/elasticsearch/snapshots/RepositoriesIT.java
Outdated
Show resolved
Hide resolved
server/src/internalClusterTest/java/org/elasticsearch/snapshots/RepositoriesIT.java
Outdated
Show resolved
Hide resolved
server/src/internalClusterTest/java/org/elasticsearch/snapshots/RepositoriesIT.java
Outdated
Show resolved
Hide resolved
Jenkins test this |
Jenkins run elasticsearch-ci/bwc (dep download failure only) |
@piyushdaftary thanks this looks really nice now, could you please fix the checkstyle issues that are currently failing CI runs:
(just some unused imports in the test class I think). You can make sure they all got fixed locally by running Thanks again! |
Thanks @original-brownbear. |
Jenkins test this |
@piyushdaftary thanks, looks good :) There is one test failure here: https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+pull-request-1/14390/testReport/junit/org.elasticsearch.repositories.fs/FsBlobStoreRepositoryIT/testIndicesDeletedFromRepository/ that looks related to the changes unfortunately. Could you look into this one please? The failure has instructions on how to reproduce it locally, check the |
Hi @original-brownbear Below is cmd I am trying to run the test with, it succeeds every time for me :
|
@original-brownbear : Can you please let me know how else I can reproduce the issue on my local machine. Till date the test Do I need to merge in latest elastic/elasticsearch - master branch code to reproduce it ? |
sorry for the delay here, had a few high pressure things incoming at the start of this week, will do my best to look into this today.
No, CI runs your exact code without any merging beforehand so it should be reproducible in theory. In practice it's often a little tricky :) I'll try to think through the change today, could be we've just change some timing in such a way that it surfaced an existing issue. I'm on it later. |
server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java
Outdated
Show resolved
Hide resolved
in deleting snapshot
Jenkins test this |
@piyushdaftary this looks good, tests seem to be passing now. Could you merge in latest |
Sync from elastic master
@original-brownbear : Thanks for reviewing code. |
@elasticmachine test this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks @piyushdaftary! Looks very nice now, I'll merge this in the coming days.
@original-brownbear: Thanks for approving the code changes. By when will it be merged to master ? |
@original-brownbear looks like this one has slipped off the radar. |
@original-brownbear are you still looking at this? |
Sorry this has taken so long @piyushdaftary, this PR is now rather stale. I've opened one afresh at #100316 and marked you as a co-author. Closing this. |
Fixes #61513
gradle check
? YesCurrent implementation cleanupStaleIndices() of snapshot deletion is very slow . Snapshot deletion code deletes each stale indices from repository one after another sequentially .
With this code changes instead of making snapshot delete of stale indices a single threaded operation we make it multithreaded operation and delete multiple stale indices in parallel using SNAPSHOT thread pool's workers.
I have added more tests to make sure outage scenario and failover scenario is handled.